<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS自定义对象方式二</title>
</head>
<body>
<script>
    let p = {
        name:"王云爽",
        age:19,
        address:"江苏南京",

        eat:function(){
            alert(this.name + "喜欢吃南京烤鸭")
        }
    }

    console.log(p)
    console.log(p.name)
    console.log(p.address)

    p.eat()
</script>
</body>
</html>